package com.jctrip.hotel.source.xxl.atour;

import com.jctrip.hotel.common.constant.XxlJobNameConstant;
import com.jctrip.hotel.common.enums.NumberEnum;
import com.jctrip.hotel.source.service.atour.AtourTaskService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author: zxy
 * @CreateTime: 2023-09-07 10:31
 * @Description:
 */
@Component
@Slf4j
public class SyncAtourPartRatesOnePushXxlJob extends IJobHandler {
    @Resource
    private AtourTaskService atourTaskService;

    @Override
    @XxlJob(XxlJobNameConstant.SYNC_AUTO_HOTEL_RATES_ONE_PUSH)
    public void execute() throws Exception {
        XxlJobHelper.log(XxlJobNameConstant.SYNC_AUTO_HOTEL_RATES_ONE_PUSH + " xxl job start");
        try {
            atourTaskService.syncAtourPartRatesPush();
        } catch (Exception e) {
            log.error(XxlJobNameConstant.SYNC_AUTO_HOTEL_RATES_ONE_PUSH + "error", e);
        }
        XxlJobHelper.log(XxlJobNameConstant.SYNC_AUTO_HOTEL_RATES_ONE_PUSH + " xxl job end");

    }
}
